<template>
	<view>
		<view class="view">
			<view class="title">{{info.Title?info.Title:info.NTitle}}</view>
			<view class="time">
				{{info.CreateUser?info.CreateUser:info.NCreateUser}}&ensp;&ensp;{{info.CreateTime?info.CreateTime:info.NCreateTime}}
			</view>
			<view class="line"></view>
			<mp-html :content="info.Content?info.Content.replace(/\/api/g, baseUrl + '/api'):info.NContent"></mp-html>
		</view>
	</view>
</template>

<script>
	import {
		appUpdateView
	} from "../../../common/api.js"

	import mpHtml from "../../../uni_modules/mp-html/components/mp-html/mp-html.vue" 
	export default {
		components: {.
			mpHtml
		},
		data() {
			return {
				info: {},
				baseUrl: getApp().globalData.requesturl,
			}
		},

		onLoad(option) {
			var subStr = new RegExp('amp;', 'ig');
			var obj = option.item.replace(subStr, "");
			this.info = JSON.parse(obj)
			console.log(this.info)                                                                                                                                            

			this.appUpdateView()
			
		},
		
		methods: {

			async appUpdateView() {
				var data = {
					Id: this.info.Id
				}
				let res = await appUpdateView(data)
			}
		}
	}
</script>

<style>
	page {
		width: 100%;
		height: 100%;
	}

	.view {
		padding-left: 48rpx;
		padding-right: 48rpx;
	}

	.title {
		width: 100%;
		height: auto;
		margin-top: 48rpx;
		/*高度自动*/
		display: inline-block;
		/*转为行内块元素*/
		white-space: pre-wrap;
		/*处理元素内的空白,保留空白符序列，但是正常地进行换行*/
		word-wrap: break-word;
		/*允许长单词或 URL 地址换行到下一行,在长单词或 URL 地址内部进行换行*/
		font-size: 36rpx;
		font-family: PingFangSC-Semibold, PingFang SC;
		font-weight: 600;
		color: #333333;
		line-height: 54rpx;
	}

	.time {
		font-size: 26rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #999999;
		line-height: 37rpx;
		margin-top: 24rpx;
		display: flex;
		flex-direction: row;
	}

	.line {
		width: 100%;
		height: 1rpx;
		background: #EBEBEB;
		border-radius: 16rpx;
		margin-top: 40rpx;
		margin-bottom: 40rpx;
	}

	.img {
		width: 100%;
		height: 413rpx;
		margin-top: 40rpx;
	}

	.content {
		width: 100%;
		height: auto;
		font-size: 30rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #333333;
		line-height: 46rpx;
		margin-top: 24rpx;
	}
</style>
